﻿@using System.Data
@{
    ViewBag.Title = "Index";
    Layout = "~/Areas/Admin/Views/Shared/AdminLayout.cshtml";
    DataTable table = ViewData["data"] as DataTable;
}

<table style="font-size: 12px;float: left;">
    <tr>
        <td>回复信息</td>
        <td>
            <input type="hidden" id="id"value="@table.Rows[0]["Id"]"/>
            <textarea id="text"  rows="10" cols="60">@table.Rows[0]["Content"]</textarea>
        </td>
    </tr>
    <tr>
        <td colspan="2">
            <div class="botton" style="margin-left: 50px;" onclick="edit()">保存</div>
            <div class="botton" style="margin-left: 50px;" onclick="javascript: history.go(-1);">取消</div>
        </td>
    </tr>
</table>

<script>
    function edit() {
        var id = $("#id").val();
        var text = $("#text").val();
        if (text.trim() == "") {
            alert("请输入回复内容！");
            return false;
        }
        $.post("@Url.Action("Edit")",{id:id,msg:text},function(row) {
            if (row > 0) {
                alert("修改成功！");
                location.reload();
            }
        });
    }
</script>